<?php
/**
 * Address 插件
 * @author 后盾向军 <houdunwangxj@gmail.com>
 */
class AddressAddon extends Addon
{

    //插件信息
    public $info = array(
        'name' => 'Address',
        'title' => '屏蔽地址',
        'description' => '屏蔽省和市',
        'status' => 1,
        'author' => '龙',
        'version' => '1.0',
        'has_adminlist' => 1,
    );

    //安装
    public function install()
    {
        if (!M()->exe("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "address`")) return false;
        if (!M()->exe("CREATE TABLE `" . C('DB_PREFIX') . "address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'aid',
  `sheng` varchar(20) DEFAULT NULL COMMENT 'sheng',
  `city` varchar(20) DEFAULT NULL COMMENT 'city',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='地址屏蔽表'")
        ) return false;
        return true;
    }

    //卸载
    public function uninstall()
    {
        if (!M()->exe("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "address`")) return false;
        return true;
    }}